package com.langshixiaobai.domain.service.trial.thread;



import com.langshixiaobai.domain.adapter.repository.IActivityRepository;
import com.langshixiaobai.domain.model.valobj.GroupBuyActivityDiscountVO;

import java.util.concurrent.Callable;

//新增加异步 FutureTask 任务，完成对活动配置的查询，商品的查询。
public class QueryGroupBuyActivityDiscountVOThreadTask implements Callable<GroupBuyActivityDiscountVO> {

    /**
     * 来源
     */
    private final String source;

    /**
     * 渠道
     */
    private final String channel;

    /**
     * 活动仓储
     */
    private final IActivityRepository activityRepository;


    public QueryGroupBuyActivityDiscountVOThreadTask(String source, String channel, IActivityRepository activityRepository) {
        this.source = source;
        this.channel = channel;
        this.activityRepository = activityRepository;
    }

    // 查询活动营销信息
    @Override
    public GroupBuyActivityDiscountVO call() throws Exception {
        //数据库查询
        return activityRepository.queryGroupBuyActivityDiscountVO(source, channel);
    }

}
